{% comment %}
  Dynamically generate list of links to all category pages
{% endcomment %}
{% assign pages_list = site.pages %}
{% for node in pages_list %}
  {% if node.title != null %}
    {% if node.layout == "category" %}
      <a class="category-link {% if page.url == node.url %} active{% endif %}"
          href="{{ site.baseurl }}{{ node.url }}">{{ node.title }}</a>
    {% endif %}
  {% endif %}
{% endfor %}